home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / wildcat / ctnews54.zip / LOGON.ZIP / LOGON.WCC < prev    next >
Text File  |  1995-06-05  |  5KB  |  171 lines

  1. ' LOGON.WCC                    enhanced by William Mantz
  2. ' from a Sample File included with MSI's wcCODE
  3. ' Authored by Unknown.  Thanks to where-ever you are.
  4. '
  5. ' It contains all the normal Wildcat! logon options first, then forces
  6. ' a NEWLETTER Read (if Newsltr was changed) No, it doesnt ask them if
  7. ' they wish to view it, it shows it to em! <g>
  8. ' Also, Added a CheckMailAtLogin for people that FAST LOGIN.
  9. '
  10. ' Summary......
  11. '
  12. ' LOGON.WCC does the NORMAL Wildcat Login as if no LOGON.WCC was here, but!
  13. ' IF it is a FAST Login, It doesn't display Hello's or Bulls, but will Display
  14. ' Newsltter (if Updated) and  CheckMail at aLOgin is performed.
  15. '
  16. '  This program also sends out a System wide page for callers loggin in
  17. '  to tell them that "Name: has just logged in." IT DOES NOT DO THIS
  18. '  for SYSOP's LOGGIN IN LOCALLY!!! Only Remote Callers. If you dont
  19. '  want this option, just edit this file and REMOVE the CALL NOTICE
  20. '  statements below.
  21. '
  22. '  Compile information:
  23. '
  24. '  WCC LOGON
  25. '
  26. ' NOTE! LOGON.WCC and LOGON.WCX MUST BE LOCATED IN THE WC! HOME DIRECTORY
  27. '       FOR IT TO WORK.
  28. ' ************************************************************************
  29.  
  30. declare function commas(x as long) as string
  31. DECLARE SUB NOTICE
  32.  
  33. dim today as datetime
  34. dim i as integer
  35. currentdatetime today
  36. dim SysopLogIn as string * 1
  37. dim n as integer, m as integer, c as integer
  38. dim nrec as NodeInfoRecord
  39. dim Page as string*79
  40. dim PgMsg as String
  41. dim Rand as integer
  42. Dim SRec as SearchRec, FileFound as Integer
  43. Dim FileDate as Date
  44. Dim FileTime as Time
  45. DIM SySop as String
  46. Dim chWstr AS STRING
  47. 'Constants
  48.  
  49. Const DateMask = "dd/mm/yy"
  50. Const TimeMask = "hh:mm"
  51. i = -1
  52. c = 0
  53. n = Node
  54. m = MaxNode
  55.  
  56. // This is for SYSOPs loggin in Locally. It will look for your
  57. // Sysop Name and just do a CheckMail at Login only.
  58.  
  59. Sysop = TRIM(Makewild.SysopName)
  60. Sysop = UCASE(Makewild.SysopName)
  61. if (LOCAL) AND User.Name=SySop THEN
  62.    checkmailatlogon
  63.    End
  64. End If
  65.  
  66. // Check for FastLogon, IF not then do the following
  67.  
  68. IF NOT (FASTLOGON) then
  69.   IF NOT(LOCAL) THEN CALL Notice
  70.   displaygroupfiles
  71.  
  72.   subtext 1, commas(nodeinfo.callernum)
  73.   select case today.t.number\60
  74.     case 0 to 719
  75.       displayprompt 1365
  76.     case 720 to 1079
  77.       displayprompt 1366
  78.     case 1080 to 1440
  79.       displayprompt 1367
  80.   end select
  81.  
  82.   if formatdate(today.d, "mm/dd") = formatdate(user.birthdate, "mm/dd") then
  83.     if not displayfile("birthday") then
  84.       beep
  85.       print
  86.       print "Happy birthday @FIRST@!"
  87.     end if
  88.     activitylog "Birthday Greeting Displayed"
  89.   end if
  90.  
  91.   hellofiles
  92.  
  93. ' checkNewsletter routine without asking <g>
  94. FileFound = FindFirst(Conference.DisplayPath+"\NEWSLTR.BBS",0,SRec)
  95. FileDate = SRec.Date
  96. FileTime = SRec.Time
  97. waitenter
  98. if User.LastCall.D.Number <= FileDate.Number THEN
  99.        DisplayFile("NewsLtr")
  100.        ACTIVITYLOG "Newsletter File Displayed"
  101. end if
  102.  
  103. ' IF you make up a file called NOANSI.BBS and place it in your
  104. ' ..\DISP path, LOGON will display it to the user. I use this
  105. ' to inform the user how to activate ANSI cursor and color.
  106.  
  107. ' Check and Display if NOT ANSI
  108. IF NOT(ANSIDETECTED) THEN
  109.         chWstr = Conference.DisplayPath + "\NOANSI.BBS"
  110.         IF EXISTS(chWstr) THEN
  111.                DisplayTextFile(chWstr)
  112.                ACTIVITYLOG "NO ANSI File Displayed"
  113.         END IF
  114. end if  ' (NOT ANISDETECTED)
  115.  
  116.  
  117.  
  118.   checkbulletins
  119.   quoteoftheday
  120.   checkmailatlogon
  121.  
  122. ELSE      '  We have a Fast Logon if ELSE route is taken.
  123. //  END OF...  IF NOT FASTLOGIN
  124.    if fastlogonchar <> "!" then
  125.       IF NOT(LOCAL) THEN CALL Notice
  126.       PRINT "@00@Command >> @0E@"
  127.       checkmailatlogon
  128.       ' checkNewsletter routine without asking <g>
  129.       FileFound = FindFirst(Conference.DisplayPath+"\NEWSLTR.BBS",0,SRec)
  130.       FileDate = SRec.Date
  131.       FileTime = SRec.Time
  132.       If User.LastCall.D.Number <= FileDate.Number THEN
  133.              DisplayFile("NewsLtr")
  134.              ACTIVITYLOG "Newsletter File Displayed"
  135.       end if
  136.    end if
  137. end if 'for if ELSE fast login
  138.  
  139. end
  140.  
  141. SUB NOTICE
  142.   Do
  143.     i = i + 1
  144.     GetNodeInfo nRec, i
  145.     If nRec.nodestatus >= 3 and i <> n then
  146.        Rand = int(rnd(100)*100)
  147.        if  Rand <= 33 then
  148.          Page = "@0C@*NOTICE*@0B@ " + User.Name + " has just arrived on node "+str(n)
  149.        elseif Rand >= 34 and Rand <= 66 Then
  150.          Page = "@0C@HEY!!!@0A@ " + User.Name + " has just logged on to node: "+str(n)
  151.        else
  152.          Page = "@0C@LOOK!!@0D@ " + User.Name +" has just dropped in on node "+str(n)+" !!"
  153.        end if
  154.        SendPage i, Page
  155.     End if
  156.   Loop until i >= m
  157. END SUB
  158.  
  159. function commas(x as long) as string
  160.   dim s as string
  161.   s = str(x)
  162.   dim j as integer
  163.   j = len(s)-2
  164.   do while j > 1
  165.     s = left(s, j-1) + "," + right(s, len(s)-j+1)
  166.     j = j - 3
  167.   loop
  168.   commas = s
  169. end function
  170.  
  171.